package com.phiture.erp.stock.web.controller.api;

import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import com.phiture.erp.stock.api.pojo.req.ErpStockOutReq;
import com.phiture.erp.stock.api.service.ErpStockOutReqApi;
import com.phiture.erp.stock.core.pojo.dto.ErpStockOutSaveReqDTO;
import com.phiture.erp.stock.core.service.ErpStockOutReqService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

@Service
@RequiredArgsConstructor
public class ErpStockOutReqApiServiceImpl implements ErpStockOutReqApi {

    private final ErpStockOutReqService stockOutReqService;

    @Override
    public Long createStockOutReq(ErpStockOutReq createReqDTO) {
        return stockOutReqService.createStockOut(BeanUtils.toBean(createReqDTO,  ErpStockOutSaveReqDTO.class));
    }

    @Override
    public void updateStockOutReqStatus(Long id, Integer status) {
        stockOutReqService.updateStockOutStatus(id, status);
    }
}
